package com.zw.sample;

public class InstructionTest {
	public static void main(String[] args) {
		int steps = 256 * 1024 * 1024;
		int[] a = new int[2];

		long time = System.currentTimeMillis();
		// Loop 1
		for (int i=0; i<steps; i++) { a[0]++; a[0]++; }
		System.out.println("Loop 1 use time : " + (System.currentTimeMillis() - time));
		
		time = System.currentTimeMillis();
		// Loop 2
		for (int i=0; i<steps; i++) { a[0]++; a[1]++; }
		System.out.println("Loop 2 use time : " + (System.currentTimeMillis() - time));
	}
}
